import request from "@/utils/request";

export default {
  // 分页搜索方法
  // page 当前页码,size每页查询条数
  search(page, size, searchMap) {
    return request({
      url: `/goods/list/search/${page}/${size}`,
      method: "post",
      data: searchMap
    });
  },

  // 新增商品
  add(pojo) {
    return request({
      url: `/goods`,
      method: "post",
      data: pojo
    });
  },

  // 删除会员
  deleteById(id) {
    return request({
      url: `/goods/${id}`,
      method: "delete"
    });
  },

  // 查询会员信息
  getById(id) {
    return request({
      url: `/goods/${id}`,
      method: "get"
    });
  },

  // 更新数据
  update(pojo) {
    return request({
      url: `/goods/${pojo.id}`,
      method: "put",
      data: pojo
    });
  }
};
